package push.tools.service.utils.crypto;

import org.apache.commons.codec.binary.Hex;

import java.util.HashMap;

public interface SecretKeyPool {
    HashMap<String, String> keyMap = new HashMap<>() {
        {
            /**
             * API加解密-秘钥
             * 使用路径：push.tools.service.framework.CryptoSupport
             */
            put("base_secret_key", formatSecretKey("kokL8G4RmNfV69cdcJ9dfnrlFGsLy6mH"));

            /**
             * 安全请求加解密-秘钥
             * 使用路径：push.tools.service.framework.service.SecurityRequestService
             */
            put("security_request_key_v107", "766hQH");
            put("security_request_key_v109", "970AbH");

            //token加解密-秘钥
            put("token_secret_key", formatSecretKey("1A0ErhOMJoZ0VHhbO6kLIDNyKC1aWG5K"));
        }
    };

    //格式化
    private static String formatSecretKey(String secretKey) {
        return Hex.encodeHexString(secretKey.getBytes());
    }
}
